package com.enzoism.spring.entity;

import java.io.Serializable;

/**
 * @program: Java_Spring01
 * @description: 对象测试
 * @author: zhifeng
 * @create: 2020-12-22 12:54
 */
public class User implements Serializable {
    private String userName;
    private Integer age;

    public User() {
        System.out.println("------------调用构造方法------------");
    }

    public void init(){
        System.out.println("------------init初始化方法------------");
    }

    public void destory(){
        System.out.println("------------destory销毁方法------------");
    }

    public void setUserName(String userName) {
        System.out.println("------------调用SetName方法------------");
        this.userName = userName;
    }
    public void setAge(Integer age) {
        System.out.println("------------调用SetAge方法------------");
        this.age = age;
    }

    @Override
    public String toString() {
        System.out.println("------------调用toString方法------------");
        return "User{" +
                "userName='" + userName + '\'' +
                ", age=" + age +
                '}';
    }
}